<?php $this->_extends('_layouts/main_basic_layout'); ?>

<?php $this->_block('resource'); ?>
<script type="text/javascript" src="<?php echo $plugin_url; ?>jquery-confirm/jquery.confirm.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $plugin_url; ?>jquery-confirm/jquery.confirm.css" />

<?php $this->_endblock(); ?>

<?php $this->_block('title'); ?>
	Jquery Plugins
<?php $this->_endblock(); ?>

<?php $this->_block('main_contents'); ?>
<div class="row-fluid">	
	<a class="btn btn-info" href="<?php echo url('jqueryplugins/add');?>">添加</a>
</div>

<div class="row-fluid">		<!-- sortable ui-sortable -->
	<div class="box span12">
		<div data-original-title="" class="box-header well">
			<h2><i class="icon-user"></i> 已添加的Html模板</h2>
		</div>
	</div>
</div>

<div id="content" class="box">
	<h1>已添加的Jquery插件</h1>
	
	<fieldset>
		<legend>已添加的Jquery插件</legend>
		<table class="full-size" style="text-align: center;">
			<thead>
				<tr>
					
					<th style="width:5%">名称</th>
					<th style="width:5%">用途类别</th>
					<th style="width:5%">区域类别</th>
					<th style="width:5%">特性类别</th>
					<th style="width:20%">描述(简述)</th>
					<th style="width:5%">根目录文件夹</th>
					<th style="width:5%">预览字符串</th>
					<th style="width:5%">字体文件</th>
					<th style="width:5%">下载包</th>
					<th style="width:3%">点击数</th>
					<th style="width:10%">生成日期</th>
					<th style="width:5%">操作</th>
				</tr>
			</thead>
			<tbody>
				<?php if(!empty($fonts)): foreach($fonts as $font): ?>
					<tr>
						<td class="name"><?php echo $font['name']; ?></td>
						<td class="type_using_name">
							<?php echo $font['type_using_name']; ?><br />
							<?php echo $font['type_using_name_en']; ?>
						</td>
						<td class="type_area_name">
							<?php echo $font['type_area_name']; ?><br />
							<?php echo $font['type_area_name_en']; ?>
						</td>
						<td class="type_feature_name">
							<?php echo $font['type_feature_name']; ?><br />
							<?php echo $font['type_feature_name_en']; ?>
						</td>
						<td class="sketch"><?php echo $font['sketch']; ?></td>
						<td class="root_foldername"><?php echo $font['root_foldername']; ?></td>
						<td class="default_preview_string">
							<?php echo $font['default_preview_string']; ?><br />
							<img width="200" height="100" src="<?php echo url('fonts/getpreviewimg', array('id' => $font['id'])); ?>" />
						</td>
						<td class="font_file"><?php echo $font['font_file']; ?></td>
						<td class="download_pack"><?php echo $font['download_pack']; ?></td>
						<td><?php echo $font['view_num']; ?></td>
						<td><?php echo $font['created_date']; ?></td>
						<td>
							<a href="<?php echo url('fonts/edit', array('id' => $font['id'])); ?>" class="edit_btn">编辑</a>
							<a class="delete_btn" href="<?php echo url('fonts/index', array('ope' => 'delete', 'id' => $font['id'])); ?>">删除</a>
						</td>
					</tr>
				<?php endforeach; endif; ?>
			</tbody>
		</table>
	</fieldset>
</div>

<script>
$('.delete_btn').click(function(){
	var thisObj = $(this);
	$.confirm({
		'title': '询问',
		'message': '确定删除?<br /><br /> <input type="checkbox" id="deletedispfilecheck" /><label for="deletedispfilecheck">同时删除磁盘上的文件</label>',
		'buttons': {
			'Yes': {
				'class': 'blue',
				'action': function(){
					if($('#deletedispfilecheck').attr('checked')){
						window.location.href = thisObj.attr('href') + '?deleteFiles=1';
					}else{
						window.location.href = thisObj.attr('href') + '?deleteFiles=0';
					}
				}
			},
			'No': {
				'class': 'gray',
				'action': function(){
					
				}
			}
		}
	});

	return false;
});
</script>
<?php $this->_endblock(); ?>